<template>
  <div>

    <Head />
    <div class="box">
      <div class="nav">
        <router-link to="/home">&lt;&nbsp;返回首页</router-link>
      </div>
      <h1>20210304001模拟考试成绩</h1>
      <p>{{ score }}分</p>
      <div class="box-content">
        <div class="left">
          <p>{{ detailPage.length * 3 }}分</p>
          <p>试卷满分</p>
        </div>
        <div class="right">
          <p>1分</p>
          <p>考试用时</p>
        </div>
      </div>
      <div class="button">
        <router-link class="btn btn-primary" to="/stest5">查看解析</router-link>
      </div>
    </div>
  </div>
</template>

<script>
import Head from "../home/Head.vue";
export default {
  components: {
    Head
  },
  data() {
    return {
      score: 0,
      detailPage: ""
    };
  },
  beforeMount() {
    this.score = +localStorage.getItem("score");
    this.detailPage = JSON.parse(localStorage.getItem("detailPage"));
  }
};
</script>

<style lang="scss" scoped>
// 头部
.header {
  width: 1200px;
  margin: 0 auto;
  padding: 0 60px;
  height: 50px;
  display: flex;
  background-color: #fff;
  align-items: center;
  justify-content: space-between;
  .userInfo {
    .img {
      width: 30px;
      height: 30px;
      border-radius: 15px;
      background-color: blue;
      margin-right: 20px;
    }
    display: flex;
    align-items: center;
  }
}
.box {
  width: 1114px;
  height: 538px;
  margin: 58px auto 0;
  padding: 20px 20px;
  text-align: center;
  color: white;
  background: url(../../assets/img/test/bgcolor.jpg) no-repeat;
  .nav {
    text-align: left;
    a {
      color: white;
    }
  }
  > p {
    margin-top: 68px;
    font-size: 41px;
  }
  h1 {
    margin-top: 32px;
    font-size: 23px;
  }
  .button {
    margin-top: 100px;
    a {
      width: 240px;
      // height: 50px;
    }
  }
  .box-content {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    font-size: 20px;
    > div {
      margin: 0 140px;
    }
  }
}
</style>
